libxl: Expose functions for helping with subprocesses.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 12 Apr 2010 16:41:05 +0000 (17:41 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 12 Apr 2010 16:41:05 +0000 (17:41 +0100)
commit25887df0dea37702586c16e1baf6681ed3ecd8de
treed2592225bcffb6d4fdc3c8abf92543a7c0b642dc
parent567326149cc6d9ba51e881604f3434f61a114f9d
libxl: Expose functions for helping with subprocesses.

 * Expose libxl_fork in libxl_utils.h
 * Expose libxl_pipe in libxl_utils.h
 * Make libxl_exec put SIGPIPE back (so that libxl callers may
    have SIGPIPE ignored)

xl would like to use libxl_fork (which is like fork(2) except that it
logs errors) and also a similar function libxl_pipe.  So put these in
libxl_utils.[ch] and use them in libxl.c as appropriate, to avoid
having to duplicate code between xl and libxl.

Also, make sure that subprocesses spawned by libxl have SIGPIPE set
back to SIG_DFL as they are entitled to expect.  This means that a
libxl caller which sets SIGPIPE to SIG_IGN is no longer buggy.  (This
is relevant for xl migration, because xl would like to be such a
caller.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_exec.c
tools/libxl/libxl_utils.c
tools/libxl/libxl_utils.h